<ui:composition template="/pages/workspace_page.xhtml"
  xmlns="http://www.w3.org/1999/xhtml"
  xmlns:ui="http://java.sun.com/jsf/facelets"
  xmlns:f="http://java.sun.com/jsf/core"
  xmlns:h="http://java.sun.com/jsf/html"
  xmlns:c="http://java.sun.com/jstl/core"
  xmlns:a4j="http://richfaces.org/a4j"
  xmlns:nxd="http://nuxeo.org/nxweb/document"
  xmlns:nxl="http://nuxeo.org/nxforms/layout"
  xmlns:nxw="http://nuxeo.org/nxforms/runtime/widget"
  xmlns:nxu="http://nuxeo.org/nxweb/util">

  <ui:define name="page title">
    <h:outputText
      value="#{nuxeoApplicationName} - #{messages['title.create.document']}" />
  </ui:define>

  <ui:define name="body">
    <div class="mainNoTabs">
      <h3>
        <h:outputText
          value="#{messages['title.create.document']} #{messages[nxd:typeInfo(changeableDocument).label]}" />
      </h3>
      <ui:include src="/incl/message_banner.xhtml" />

      <h:form enctype="multipart/form-data" id="document_create" styleClass="safeEditEnabled" >
        <nxl:documentLayout mode="create" value="#{changeableDocument}" />
        <div class="buttonsGadget">
          <input type="hidden" name="parentDocumentPath"
            value="#{currentDocument.pathAsString}" />
          <nxw:documentCreateButtons mode="view" value="#{changeableDocument}" />
        </div>
      </h:form>
      <h:outputScript target="#{pageJsTarget}">
        jQuery(document).ready(function() {
          jQuery('#document_create').focusFirst();
          jQuery('#document_create').initSafeEditOnForm("create-#{currentDocument.id}-#{changeableDocument.type}", "#{messages['safeedit.page.has.unsaved.changes']}");
        });
     </h:outputScript>
    </div>
  </ui:define>

</ui:composition>